from django.db import models
import xml.etree.ElementTree as ET
import urllib2
import time

class weather(models.Model):
    print time.time()
    try:
        url = "http://www.yr.no/place/China/Beijing/Beijing/forecast.xml"
        f = urllib2.urlopen(url, timeout=5)
        open('data.txt', 'wb').write(f.read())
        tree = ET.parse(xml)
        tree.find('weatherdata/forecast/tabular')
    except Exception, e:
        print e
    print time.time()

